@import '../../styles/theme.scss';

.container {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #f1f5f9 100%);
  position: relative;
  overflow: hidden;
}

// 动态背景效果
.backgroundEffect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  
  .particle1 {
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--gradient-primary);
    border-radius: 50%;
    top: 10%;
    left: -50px;
    opacity: 0.1;
    filter: blur(80px);
    animation: float 15s infinite ease-in-out;
  }
  
  .particle2 {
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    top: 60%;
    right: -30px;
    opacity: 0.08;
    filter: blur(60px);
    animation: float 20s infinite ease-in-out reverse;
  }
  
  .particle3 {
    position: absolute;
    width: 150px;
    height: 150px;
    background: var(--gradient-blue);
    border-radius: 50%;
    bottom: 20%;
    left: 50%;
    opacity: 0.06;
    filter: blur(40px);
    animation: float 25s infinite ease-in-out;
  }
  
  @keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.1); }
    66% { transform: translate(-20px, 30px) scale(0.9); }
  }
}

// 侧边栏样式
.sidebar {
  width: 280px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 100;
  
  .sidebarContent {
    padding: var(--spacing-lg);
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    
    // 自定义滚动条
    &::-webkit-scrollbar {
      width: 6px;
    }
    
    &::-webkit-scrollbar-track {
      background: var(--bg-tertiary);
      border-radius: var(--radius-full);
    }
    
    &::-webkit-scrollbar-thumb {
      background: var(--border-medium);
      border-radius: var(--radius-full);
      
      &:hover {
        background: var(--border-dark);
      }
    }
  }
}

// 用户信息卡片
.userCard {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-sm) !important;
  
  :global(.ant-card-body) {
    padding: var(--spacing-md) !important;
  }
  
  .userInfo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    
    .avatar {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      overflow: hidden;
      border: 2px solid var(--primary-color);
      background: var(--gradient-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      
      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
    
    .userDetails {
      flex: 1;
      
      h5 {
        margin: 0 0 var(--spacing-xs) 0 !important;
        color: var(--text-primary);
        font-weight: 600;
      }
      
      :global(.ant-typography) {
        margin: 0;
        font-size: var(--font-size-sm);
      }
    }
  }
}

// 新建问卷按钮
.createButton {
  height: 50px !important;
  border-radius: var(--radius-lg) !important;
  background: var(--gradient-primary) !important;
  border: none !important;
  font-weight: 600 !important;
  font-size: var(--font-size-md) !important;
  box-shadow: var(--shadow-md) !important;
  transition: all var(--transition-normal) !important;
  
  &:hover {
    background: var(--gradient-primary) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-lg) !important;
  }
  
  &:disabled {
    background: var(--gradient-primary) !important;
    opacity: 0.7;
    transform: none !important;
  }
}

// 导航部分
.navigation {
  .navTitle {
    color: var(--text-secondary) !important;
    font-size: var(--font-size-sm) !important;
    font-weight: 600 !important;
    margin-bottom: var(--spacing-md) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .navItems {
    width: 100%;
    
    :global(.ant-space-item) {
      width: 100%;
    }
  }
  
  .navButton {
    height: 48px !important;
    border-radius: var(--radius-md) !important;
    justify-content: flex-start !important;
    padding: 0 var(--spacing-md) !important;
    border: 1px solid transparent !important;
    transition: all var(--transition-fast) !important;
    position: relative;
    
    &:not(.active) {
      background: transparent !important;
      color: var(--text-secondary) !important;
      
      &:hover {
        background: var(--bg-secondary) !important;
        color: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
        transform: translateX(4px);
      }
    }
    
    &.active {
      background: var(--gradient-primary) !important;
      color: var(--text-white) !important;
      box-shadow: var(--shadow-md) !important;
      
      &::before {
        content: '';
        position: absolute;
        left: -1px;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--text-white);
        border-radius: 0 2px 2px 0;
      }
    }
    
    .navLabel {
      flex: 1;
      text-align: left;
      font-weight: 500;
    }
    
    .navBadge {
      :global(.ant-badge-count) {
        font-size: var(--font-size-xs);
        font-weight: 600;
        min-width: 20px;
        height: 20px;
        line-height: 20px;
        border-radius: var(--radius-full);
      }
    }
  }
}

// 快捷操作
.quickActions {
  .navTitle {
    color: var(--text-secondary) !important;
    font-size: var(--font-size-sm) !important;
    font-weight: 600 !important;
    margin-bottom: var(--spacing-md) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .actionGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    
    .actionButton {
      width: 100% !important;
      height: 50px !important;
      border-radius: var(--radius-md) !important;
      border: 1px solid var(--border-light) !important;
      background: var(--bg-primary) !important;
      color: var(--text-secondary) !important;
      transition: all var(--transition-fast) !important;
      
      &:hover {
        border-color: var(--primary-color) !important;
        color: var(--primary-color) !important;
        background: rgba(99, 102, 241, 0.05) !important;
        transform: translateY(-2px);
        box-shadow: var(--shadow-sm) !important;
      }
      
      .anticon {
        font-size: 1.2rem;
      }
    }
  }
}

// 统计信息卡片
.statsCard {
  margin-top: auto;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-light) !important;
  background: var(--gradient-primary) !important;
  
  :global(.ant-card-body) {
    padding: var(--spacing-md) !important;
  }
  
  .statsContent {
    display: flex;
    justify-content: space-between;
    
    .statItem {
      text-align: center;
      
      .statNumber {
        font-size: var(--font-size-lg);
        font-weight: 700;
        color: var(--text-white);
        line-height: 1;
        margin-bottom: var(--spacing-xs);
      }
      
      .statLabel {
        font-size: var(--font-size-xs);
        color: rgba(255, 255, 255, 0.8);
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
    }
  }
}

// 主内容区域
.main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  
  .mainContent {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    min-height: 0;
    
    // 自定义滚动条
    &::-webkit-scrollbar {
      width: 8px;
    }
    
    &::-webkit-scrollbar-track {
      background: var(--bg-tertiary);
      border-radius: var(--radius-full);
    }
    
    &::-webkit-scrollbar-thumb {
      background: var(--border-medium);
      border-radius: var(--radius-full);
      
      &:hover {
        background: var(--border-dark);
      }
    }
  }
}

// 响应式设计
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
    
    .sidebarContent {
      padding: var(--spacing-md);
    }
  }
  
  .main .mainContent {
    padding: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    
    &.open {
      transform: translateX(0);
    }
    
    .sidebarContent {
      height: auto;
      max-height: 100vh;
      padding: var(--spacing-md);
      
      .statsCard {
        margin-top: var(--spacing-lg);
      }
    }
  }
  
  .main {
    .mainContent {
      padding: var(--spacing-md);
      margin-top: 60px; // 为移动端顶部导航留空间
    }
  }
  
  // 简化快捷操作网格
  .quickActions .actionGrid {
    grid-template-columns: repeat(4, 1fr);
    
    .actionButton {
      height: 40px !important;
      
      .anticon {
        font-size: 1rem;
      }
    }
  }
  
  // 减少动画以提升移动端性能
  .backgroundEffect {
    .particle2,
    .particle3 {
      display: none;
    }
  }
}

// 暗色主题支持
@media (prefers-color-scheme: dark) {
  .sidebar {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--border-dark);
  }
  
  .userCard,
  .statsCard {
    background: var(--bg-dark) !important;
    border-color: var(--border-dark) !important;
  }
}